import {createRouter,createWebHashHistory,RouteRecordRaw} from "vue-router"

//配置路由
const routes:Array<RouteRecordRaw>=[
{
    path:"/",
    component:()=>import('../views/Hello.vue'),
    children:[ {
        path:"/home",
        name:'home',
        component:()=>import('../views/Home.vue'),
        meta: { 
            title:"首页",
            keepAlive: true, 
           } 
    },
    {
        path:"/detail/:id",
        name:'detail',
        component:()=>import('../views/Detail.vue'),
        meta: { 
            title:"详情",
            keepAlive: true, 
           } 
    },
    {
        path:"/addArticle/:state/:id",
        name:'addArticle',
        component:()=>import('../views/AddArticle.vue'),
        meta: { 
            title:"文章设置",
            keepAlive: true, 
           } 
    },
        {
            path:"/about",
            name:'about',
            component:()=>import('../views/About.vue'),
            meta: {
                title:"简介",
                keepAlive: true,
            }
        },
    {
        path:"/articleList",
        name:'articleList',
        component:()=>import('../views/ArticleList.vue'),
        meta: { 
            title:"文章列表",
            keepAlive: true, 
           } 
    }

]
}
   


   
]

const router=createRouter({
    history:createWebHashHistory(),
    routes
})
//导出
export default router;